<?php

namespace App\Model\Baiyou;

use App\Model\BaseModel;
use EasySwoole\EasySwoole\Config;
use EasySwoole\ORM\Utility\Schema\Table;


/**
 * This is the model class for table "{{%patient_infusion_queue}}".
 *
 * @property int $id
 * @property int $project_id 项目ID
 * @property int $patient_user_id 患者ID
 * @property int $type 类型【1静滴、2肌注】
 * @property int $order_num 排队号码【每天重置】
 * @property int $status 状态【1等待叫号、2叫号中、3完成、9作废】
 * @property int $call_time 叫号时间
 * @property int $finish_time 完成输液时间
 * @property int $operate_id 操作人ID
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class PatientInfusionQueue extends BaseModel
{
    const TYPE_JD = 1;// 静滴
    const TYPE_JZ = 2;// 肌注

    const STATUS_WAIT = 1;// 等待
    const STATUS_CALLING = 2;// 叫号中
    const STATUS_FINISH = 3;// 完成
    const STATUS_CANCEL = 9;// 作废

    const WAIT_TIME = 15;// 叫号等待时间

    public static $callTypes = [
        self::TYPE_JD => '输液台',
        self::TYPE_JZ => '肌肉注射室',
    ];

    // 指定连接名称
//    protected $connectionName = 'dengta';

    public function __construct(array $data = [])
    {
        $tablePrefix = Config::getInstance()->getConf("MYSQL.tablePrefix");
        $name = $tablePrefix . "patient_infusion_queue";
        $this->tableName($name);

        parent::__construct($data);
    }
}
